Conventionally, an object (sound source) is displayed so that it appears to be provided in a virtual three-dimensional space and generate a sound. To do so, a process is executed so that the sound is heard from a direction in which the object is located.
In conventional techniques, a sound is output based on the direction and distance of a sound source which are determined as viewed from a virtual camera. Therefore, for example, there is room for improvement with regard to enabling a user to more easily localize or identify a sound from an object or area to which the user desires or is required to pay attention.
Therefore, it is an object of an exemplary embodiment to provide an information processing program, information processing device, information processing system, and information processing method which perform a novel process on a sound of a sound source in an environment in which the sound source is provided in a virtual space.
In order to achieve the object, exemplary embodiments have configurations as follows.
An exemplary embodiment is a computer-readable storage medium storing an information processing program executable by a computer of an information processing device for outputting a sound of a sound source in a virtual space. The program causes the computer to execute calculating a direction of the sound source with reference to a first location in the virtual space, calculating a volume of the sound based on a second location different from the first location and a location of the sound source, and outputting the sound of the sound source based on the calculated direction and volume.
With the above configuration, the direction of the sound source is calculated with reference to the first location, and the volume of the sound is calculated based on the second location and the location of the sound source. Thereafter, the sound is output based on the calculated direction and volume. As a result, for example, the volume of the sound of the sound source can be changed while a location relationship between the first location and the sound source is maintained.
In another configuration, the program may cause the computer to further execute displaying, on a display device, an image of the virtual space captured by a virtual camera. The first location may be set based on a location of the virtual camera.
With this configuration, the image of the virtual space captured by the virtual camera is displayed. The first location is set based on the location of the virtual camera. As a result, for example, the volume of the sound source to which attention should be paid can be increased while a location relationship between the virtual camera and the sound source is correctly maintained.
In another configuration, the second location may be set to a predetermined location within an imaging range of the virtual camera.
With this configuration, the second location is set to a predetermined location within the imaging range of the virtual camera. As a result, for example, the sound corresponding to a displayed image can be output, i.e., the volume of a sound in a region which can be viewed by the user can be increased while the volume of a sound in a region which cannot be viewed by the user can be decreased.
In another configuration, the second location may be set based on a gazing point of the virtual camera.
With this configuration, the sound of a sound source located in the vicinity of the second location set based on the gazing point of the virtual camera can be increased. For example, the user is allowed to pay attention to the sound source both visually and auditorily.
In another configuration, the second location may be set between the gazing point of the virtual camera and the virtual camera.
With this configuration, the second location is set between the gazing point of the virtual camera and the virtual camera. Therefore, a satisfactory balance can be provided between the volume of a sound of a sound source around the virtual camera and the volume of a sound of a sound source around the gazing point.
In another configuration, the second location may be set in the vicinity of the gazing point of the virtual camera.
With this configuration, the volume of a sound of a sound source located in the vicinity of the gazing point of the virtual camera can be increased.
In another configuration, the program may cause the computer to further execute controlling the virtual camera based on a user's operation, controlling the virtual camera without the user's operation, and switching a control mode of the virtual camera between a first control mode in which the virtual camera is controlled based on the user's operation and a second control mode in which the virtual camera is controlled without the user's operation. The second location may be set between the gazing point of the virtual camera and the virtual camera in the first control mode, and in the vicinity of the gazing point of the virtual camera in the second control mode.
With this configuration, the control mode can be switched between the first control mode and the second control mode, and the second location is set based on the control mode.
In another configuration, an operation object set in the virtual space may be controlled based on the user's operation.
With this configuration, the operation object as well as the virtual camera can be controlled by the user's operation.
In another configuration, the first location may be set to a location of the virtual camera.
With this configuration, the direction of a sound source is calculated with reference to the virtual camera. Therefore, the way in which a sound of the sound source is heard can be changed based on the direction of the sound source as viewed from the virtual camera, and the volume of the sound can be changed based on the second location different from the location of the virtual camera.
In another configuration, a localized position of the sound source may be calculated with reference to the first location.
In another configuration, the volume of the sound may be calculated so that the volume of the sound decreases with increasing distance between the second location and the sound source.
With this configuration, the volume of the sound can be decreased as the sound source is located further away from the second location.
In another configuration, the program may cause the computer to further execute calculating a relative motion of the sound source with reference to a third location fixed or movable in the virtual space. The sound corrected based on the relative motion may be output.
Here, the third location may be fixed or movable in the virtual space. In other words, the sound may be corrected as the third location moves, as the sound source moves, or as both the third location and the sound source move.
With this configuration, the sound can be corrected based on a relative motion of the sound source with reference to the third location. For example, the sound can be corrected, taking the Doppler effect into consideration.
In another configuration, a player object controllable based on the user's operation may be provided in the virtual space. In this case, the first location may be set based on a location of the player object.
With this configuration, for example, the second location can be changed while a location relationship between the player object and the sound source is maintained, and the volume of a sound of the sound source to which the user should pay attention can be increased.
An exemplary embodiment may be an information processing device (information processing system) for executing the above information processing program. The information processing system may include a single device or a plurality of devices which operate in cooperation with each other. An exemplary embodiment may be an information processing method executable in the information processing system.
According to an exemplary embodiment, a novel process can be performed on a sound of a sound source in an environment in which the sound source is provided in a virtual space.
These and other objects, features, aspects and advantages of the exemplary embodiments will become more apparent from the following detailed description of the exemplary embodiments when taken in conjunction with the accompanying drawings.